<%@ page contentType="text/html;charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/common/taglibs.jsp"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title><s:text name="context.title"/></title>
<%@ include file="/common/meta.jsp"%>
  <link rel="stylesheet" href="${ctx}/js/cluetip/jquery.cluetip.css" type="text/css" />

<script src="${ctx}/js/cluetip/jquery.cluetip.min.js" type="text/javascript"></script>
<script type="text/javascript" language="javascript">

          var pageTotalPages = "1";
          var pageNo = "";
        $(document).ready(function() {
        	
        	  $('.cluetip-link').cluetip({sticky: true,width:500, closePosition: 'title', arrows: true,ajaxCache:false});
        	var pageTotalPages = $("#pageTotalPages").val();
            var pageNo = $("#pageNo").val();
            $("#pager").pager({ pagenumber: pageNo, pagecount: pageTotalPages, buttonClickCallback: PageClick });
        });

        PageClick = function(pageclickednumber) {
            $("#pager").pager({ pagenumber: pageclickednumber, pagecount: pageTotalPages, buttonClickCallback: PageClick });
           // $("#result").html("Clicked Page " + pageclickednumber);
            jumpPage(pageclickednumber);
        }

        var idTmr = "";
        function exp2(tableid) //读取表格中每个单元到EXCEL中 
        { 
            var curTbl = document.getElementById(tableid); 
            var oXL;
             try {
             	oXL = new ActiveXObject("Excel.Application"); 
           	  //插件初始化失败时作出提示
           	 }catch (e) {
           	  alert("无法启动Excel!\n\n如果您确信您的电脑中已经安装了Excel，"+"那么请调整IE的安全级别。\n\n具体操作：\n\n"+"工具 → Internet选项 → 安全 → 可信站点 →站点 →输入本网站的域名或IP地址 →添加 →关闭 → 自定义级别 → 对没有标记为安全的ActiveX进行初始化和脚本运行 → 启用 ");	
           	  return false;
           	 }
             //创建AX对象excel 
             var oWB = oXL.Workbooks.Add(); 
             //获取workbook对象 
            var oSheet = oWB.ActiveSheet; 
            //激活当前sheet 
             var Lenr = curTbl.rows.length; 
             //取得表格行数 
             for (i = 0; i < Lenr; i++) 
             { 
                 var Lenc = curTbl.rows(i).cells.length; 
                 //取得每行的列数 
                 for (j = 0; j < Lenc; j++) 
                 { 
                     oSheet.Cells(i + 1, j + 1).value = curTbl.rows(i).cells(j).innerText; 
                     //赋值 
                 } 
             } 
             oXL.Visible = true; 
             //设置excel可见属性
            oXL.Quit();
            oXL = null;
             // 调用Cleanup（）进行垃圾回收
             idTmr = window.setInterval("Cleanup();",10);
        }
        function Cleanup() {
            window.clearInterval(idTmr);
            CollectGarbage();
  		}
        
    </script>
</head>
<body>
<form action="upload-score" method="post" id="mainForm">
<input type="hidden" name="page.pageNo" id="pageNo" value="${page.pageNo}"/>
<input type="hidden" name="page.orderBy" id="orderBy" value="${page.orderBy}"/>
<input type="hidden" name="page.order" id="order" value="${page.order}"/>
<input type="hidden" id="pageTotalPages"  value="${page.totalPages}"/>
<br/>
<p align="center"><s:actionmessage theme="mytheme" cssClass="actionMessage"/></p>
<h1 class="title01"><img src="${ctx}/images/02_15.gif" width="45" height="42" class="fl"/>论文成绩上报</h1>
<fieldset class="fs_ys" style="width: 800px">
<legend>查询</legend>
<table align="center" id="contentTable" class="table_ys_input" >
	<tr>
		<td nowrap>教师姓名&nbsp;</td>
		<td><input type="text" name="teacherName" value="${teacherName}"/></td>
		<td nowrap>题目名称&nbsp;</td>
		<td colspan="">
			<input type="text" name="titile" value="${titile}"/>
		&nbsp;</td>
		
		<td><center><input type="submit"  value="  查询  "/></center></td>
	</tr>
</table>
		
</fieldset>
<s:if test="listAll!=null && listAll.size()!=0 ">
<a href="javascript:exp2('contentTablessss')" class="ui-state-default ui-corner-al" style="padding:3px 10px;text-decoration:none;"class="ui-state-default ui-corner-al" style="padding:3px 10px;text-decoration:none;">导出</a>
<table id="contentTablessss" class="table_ys tableColor">
	<tr>
		<th nowrap="nowrap" colspan="">序号</th>
		<th nowrap="nowrap"><a href="javascript:sort('titile','asc')">题目</a></th>
		<th nowrap="nowrap">学生姓名</th>
		<th nowrap="nowrap">学号</th>
		<th nowrap="nowrap">成绩</th>
	</tr>
	<s:iterator value="listAll" var="v" status="st">
	<tr>
		<td>${st.index + 1 }&nbsp;</td>
		<td><a class="ui-state-default ui-corner-al" style="padding:3px 10px;text-decoration:none;" href="end-score!input?id=${v.id }">${v.titile }</a>&nbsp;</td>
		<td>${studentName }&nbsp;</td>
		<td>${studentNo }&nbsp;</td>
		<td>
			${allScore }
		&nbsp;</td>
	</tr>
	</s:iterator>
</table>
<div align="center" id="pager" ></div>
</s:if>
</form>
</body>

</html>